<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('菜单管理')"></head>
<body class="easyui-layout">
<div style="width: 100%" data-options="region:'west',split:true,border:true,title:'菜单树'">
    <div style="margin-left: 50px;">
        <input id="ss" class="easyui-searchbox" style="width:200px"
               data-options="prompt:'搜 索'"/>
        <ul id="treeContent" class="easyui-tree"></ul>
        <div id="nav" class="easyui-menu" style="width:120px;">
            <shiro:hasPermission name="system:menu:getRegion">
                <div id="0" data-options="iconCls:'icon-cart'">按钮管理</div>
            </shiro:hasPermission>
            <shiro:hasPermission name="system:menu:add">
                <div id="2" data-options="iconCls:'icon-add'">添加</div>
            </shiro:hasPermission>
            <shiro:hasPermission name="system:menu:edit">
                <div id="3" data-options="iconCls:'icon-edit'">修改</div>
            </shiro:hasPermission>
            <shiro:hasPermission name="system:menu:del">
                <div id="4" data-options="iconCls:'icon-cancel'">移除</div>
            </shiro:hasPermission>
        </div>
    </div>
</div>

<div id="dlg" class="easyui-dialog" style="width:650px;height:400px"
     closed="true" modal="true" maximizable="true" resizable="true">

    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" name="id">
                <tr>
                    <td>菜单名称：</td>
                    <td><input name="name" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入菜单名称">
                    </td>
                    <td>菜单类型：</td>
                    <td><input id="type" name="type" class="easyui-combobox"
                               data-options="required:true,valueField:'value',textField:'showmsg',panelHeight:'auto',prompt:'==请选择=='"
                               missingMessage="请维护菜单类型" validType="comboxValidate['type','请维护菜单类型']"/>
                    </td>
                </tr>
                <tr>
                    <td>菜单级别：</td>
                    <td><input name="level" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入菜单级别"></td>
                    <td>菜单顺序：</td>
                    <td><input class="easyui-validatebox"
                               data-options="required:true"
                               name="sequence" missingMessage="请输入字段位数,必须大于0正整数！" validType="integerZero"/></td>
                    </td>
                </tr>
                <tr>
                    <td>菜单地址：</td>
                    <td><input name="url" class="easyui-validatebox"></td>
                    <td>权限编码：</td>
                    <td><input name="permissions" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入权限编码"></td>
                </tr>
                <tr>
                    <td>菜单图标：</td>
                    <td><input name="icon" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入菜单图标"></td>
                </tr>
                <tr>
                    <td>上级菜单：</td>
                    <td colspan="3">
                        <input id="parentId" name="parentId" style="width: 350px"
                               data-options="required:true,prompt:'==请选择==',panelHeight:'auto'"
                               class="easyui-combotree"
                               missingMessage="请选择上级菜单" validType="comtreeValidate['parentId','请选择上级菜单']"/>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div id="dlgRegion" class="easyui-dialog" style="width:650px;height:400px"
     closed="true" modal="true" maximizable="true" resizable="true" buttons="#dlg-buttonsRegion">
    <div id="dgRegion"></div>
    <div id="dlg-buttonsRegion" style="text-align:center">
        <shiro:hasPermission name="system:menu:addRegion">
            <a id="addValue" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add"
               onclick="addRegion()">添加</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="system:menu:editRegion">
            <a id="editValue" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit"
               onclick="editRegion()">修改</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="system:menu:delRegion">
            <a id="delValue" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
               onclick="delRegion()">删除</a>
        </shiro:hasPermission>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-back"
           onclick="$('#dlgRegion').dialog('close')">返回</a>
    </div>
</div>

<div id="dlgRegionDetail" class="easyui-dialog" style="width:400px;height:300px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form method="post" id="myformRegion">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" name="id">
                <input type="hidden" id="menuId" name="menuId"/>
                <tr>
                    <td>按钮名称：</td>
                    <td><input name="name" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入按钮名称">
                    </td>
                </tr>
                <tr>
                    <td>按钮顺序：</td>
                    <td><input class="easyui-validatebox"
                               data-options="required:true"
                               name="sequence" missingMessage="请输入字段位数,必须大于0正整数！" validType="integerZero"/></td>
                    </td>
                </tr>
                <tr>
                    <td>按钮图标：</td>
                    <td><input name="icon" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入菜单图标"></td>
                </tr>
                <tr>
                    <td>权限编码：</td>
                    <td><input name="permissions" class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入权限编码"></td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/system/menu.js}"></script>
<script type="text/javascript"
        th:src="@{/js/system/region.js}"></script>
</body>
</html>
